package com.example.demo.controller;

import com.example.demo.pojo.Order;
import com.example.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping(value="order")
@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    @RequestMapping(value="/hi")
    public String hi(@RequestParam(defaultValue = "alvin",required = false) String name){
        return orderService.sayHi(name);
    }
    @RequestMapping(value="/detail")
    public Order detail(@RequestParam(name = "id") String id){
        return orderService.detail(id);
    }
}
